package com.may.jwt.autoconfigure.entity;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Collections;
import java.util.List;

/**
 * @author mayuanbao
 * @date 2020-11-10 20:50
 */
@ConfigurationProperties(prefix = "token")
public class TokenProperties {
    /**
     * 签名
     */
    private String signature = "!QAZzaq11234QWERasdfZXCV";
    /**
     * accessToken 过期时间，单位为分
     */
    private Integer accessExpireTime = 30;
    /**
     * refreshToken 过期时间，单位为分
     */
    private Integer refreshExpireTime = 60;
    /**
     * 需要校验token的路径
     */
    private List<String> pathPattern = Collections.singletonList("/**");
    /**
     * 不需要校验token的路径
     */
    private List<String> excludePathPattern = Collections.singletonList("/**/login");

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public Integer getAccessExpireTime() {
        return accessExpireTime;
    }

    public void setAccessExpireTime(Integer accessExpireTime) {
        this.accessExpireTime = accessExpireTime;
    }

    public Integer getRefreshExpireTime() {
        return refreshExpireTime;
    }

    public void setRefreshExpireTime(Integer refreshExpireTime) {
        this.refreshExpireTime = refreshExpireTime;
    }

    public List<String> getPathPattern() {
        return pathPattern;
    }

    public void setPathPattern(List<String> pathPattern) {
        this.pathPattern = pathPattern;
    }

    public List<String> getExcludePathPattern() {
        return excludePathPattern;
    }

    public void setExcludePathPattern(List<String> excludePathPattern) {
        this.excludePathPattern = excludePathPattern;
    }
}
